package com.ltmall.api.comm.https;

import java.util.HashMap;
import java.util.Map;

public class TestMain {
    private String url = "https://openapi.alipay.com/gateway.do";
    private String charset = "utf-8";
    private HttpClientUtil httpClientUtil = null;

    public TestMain() {
        httpClientUtil = new HttpClientUtil();
    }

    public void test() {
//	    	String appid="wx46e1d4377e2b58e6";
//			String mch_id = "1336857501";	
//			String nonce_str = "12345";	
//			String sign = "cvasdbvasbadcasdvasddcwcsdc";	
//			String out_trade_no = "NO201606261404593078005505";	
//			String out_refund_no = "24534578542";	
//			
//			String total_fee = "1";	
//			String refund_fee = "1";
//			String op_user_id = "354265354";


        Map<String, String> createMap = new HashMap<String, String>();

//	        createMap.put("appid",appid);  
//	        createMap.put("mch_id",mch_id);  
//	        createMap.put("nonce_str",nonce_str);  
//	        createMap.put("sign",sign);  
//	        createMap.put("out_trade_no",out_trade_no);  
//	        createMap.put("out_refund_no",out_refund_no);  
//	        createMap.put("total_fee",total_fee);  
//	        createMap.put("refund_fee",refund_fee);  
//	        createMap.put("op_user_id",op_user_id);  

        createMap.put("app_id", "2014072300007148");
        createMap.put("method", "alipay.trade.refund");
        createMap.put("charset", "utf-8");
        createMap.put("sign_type", "RSA");
        createMap.put("sign", "e9zEAe4TTQ4LPLQvETPoLGXTiURcxiAKfMVQ6Hrrsx2hmyIEGvSfAQzbLxHrhyZ48wOJXTsD4FPnt+YGdK57+fP1BCbf9rIVycfjhYCqlFhbTu9pFnZgT55W+xbAFb9y7vL0MyAxwXUXvZtQVqEwW7pURtKilbcBTEW7TAxzgro=");
        createMap.put("timestamp", "2014-07-24 03:07:50");
        createMap.put("version", "1.0");
        createMap.put("out_trade_no", "");
        createMap.put("refund_amount", "1");


        String httpOrgCreateTestRtn = httpClientUtil.doPost(url, createMap, charset);
        System.out.println("result:" + httpOrgCreateTestRtn);
    }

    public static void main(String[] args) {
        TestMain main = new TestMain();
        main.test();
    }
}
